package org.linlinjava.litemall.wx.service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.LitemallResellerApply;
import org.linlinjava.litemall.db.domain.LitemallUser;
import org.linlinjava.litemall.db.domain.LitemallUserMember;
import org.linlinjava.litemall.db.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WxUserService {
    private final Log logger = LogFactory.getLog(WxUserService.class);

    @Autowired
    private LitemallUserService userService;
    @Autowired
    private LitemallUserMemberService userMemberService;

    /**
     * 申请经销商
     *
     * @param apply
     * @return
     */
    public Object applyForReseller(LitemallResellerApply apply) {
        return ResponseUtil.ok();
    }

    public Boolean isMember(Integer userId) {
        LitemallUserMember userMember = userMemberService.findByUid(userId);
        return userMember != null;
    }

    public Boolean hasPayDeposit(Integer userId) {
        LitemallUser user = userService.findById(userId);
        return user.getHasPayDeposit();
    }

}